Hardware Drawing Capabilities

Some renderers can draw directly to video hardware as they decompress video frames. These renderers return the VIDCF_DRAW flag in response to the ICGetInfo10NQ.GV function. When using this type of renderer, your application does not have to handle the decompressed data. It lets the renderer retain the decompressed data for drawing.

If your application uses a renderer with drawing capabilities, it must handle the following tasks:

    Select a renderer.

    Specify image formats.

    Initialize the renderer.

    Draw the data.

    Control drawing parameters.

 

Renderer Selection

The ICDrawOpenD70R9_ macro opens a renderer that can draw images with the specified format. It returns a handle of a renderer if it is successful, or zero otherwise. This macro uses the ICLocate11FA8SY function to open the renderer.

Specifying Image Formats

Because your application does not need to draw the decompressed data, it does not require a specific output format. It must, however, ensure that the renderer can draw using the input format by using the ICM_DRAW_QUERY55K29W5 message (or use the ICDrawQueryD1SFL7 macro). This message cannot determine if a renderer can draw a bitmap. If your application must determine if the renderer can draw the bitmap, use this message with the ICDrawBeginCMCHBW function.

Your application can have a renderer suggest an input format by using the ICDrawSuggestFormat4VCCJ2 function. This function is used when a renderer separates the drawing capabilities from the decompressing capabilities. Most applications using the drawing functions will not need to determine the output format.

Renderer Initialization

The ICDrawBeginCMCHBW function initializes a renderer and tells it the drawing destination. This function can also perform the following tasks:

    Determine whether the renderer supports a specific input format.

    Specify whether the drawing operation occupies a window or the entire screen.

    Specify the part of the image to display using the source rectangle.

    Define the playback rate of the image sequence.

 

Some renderers buffer the compressed data to operate more efficiently. Your application can send the ICM_GETBUFFERSWANTEDGL986K message (or use the ICGetBuffersWantedPF.55W macro) to determine the number of buffers the renderer requests. Your application should preload these buffers and send them to the renderer before drawing.

Drawing the Data

You can use the ICDraw174LK02 function to decompress the data for drawing. The renderer, however, does not start drawing data until your application sends the ICM_DRAW_START1OIK886 message (or uses the ICDrawStartD3RBL2 macro). When your application calls this function, the renderer begins to draw the frames at the rate specified by the dwRate parameter divided by the dwScale parameter; these parameters were supplied when the application initialized the renderer by using the ICDrawBeginCMCHBW function. Drawing continues until your application sends the ICM_DRAW_STOP_YDL_W message (or uses the ICDrawStop1SIVUG4 macro).

 

Note  If a renderer buffers the data before drawing, your application should not use the ICDrawStart macro until it has sent the number of frames the renderer returned for the ICGetBuffersWanted macro.

 

The lTime parameter of ICDraw174LK02 specifies the time to draw a frame. The renderer divides this integer by the time scale specified with ICDrawBeginCMCHBW to obtain the actual time. Times for ICDraw functions are relative to ICDrawStart. ICDrawStart sets the clock to zero. For example, if your application specifies 1000 for the time scale and 75 for lTime, the renderer draws the frame 75 milliseconds into the sequence.

Controlling Drawing Parameters

You can monitor the clock of a renderer by sending the ICM_DRAW_GETTIME1XBPR2L message (or use the ICDrawGetTimeRNJ47K macro), and you can set the clock of a renderer that can draw data by sending the ICM_DRAW_SETTIME3P8HXW3 message (or use the ICDrawSetTime3.MN0HB macro).

To change the current position while a renderer is drawing, your application can send the ICM_DRAW_WINDOW1Z.KZV4 message (or use the ICDrawWindowD.KK85 macro) for repositioning the window. Applications typically use this message whenever the window changes.

If the playback window gets a realize-palette message, your application must send the ICM_DRAW_REALIZEN4GZHY message (or use the ICDrawRealize0IM.0_ macro) to have the renderer realize the palette again for playback. Applications can change the palette by sending the ICM_DRAW_CHANGEPALETTE.0EL17 message (or use the ICDrawChangePaletteGEPU4O macro) and obtain the current palette by sending the ICM_DRAW_GET_PALETTEOV0GGS message.

Some renderers must be specifically instructed to display frames passed to them. Sending the ICM_DRAW_RENDERBUFFER10S.OBW message (or use the ICDrawRenderBufferVCIHVE macro) causes these renderers to draw the frame.